﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class CandidateBriefDashboard : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        gvRegistrationStatusDashboard.DataSource = GetDataSet();
        gvRegistrationStatusDashboard.DataBind();
    }

    private DataSet GetDataSet()
    {
        DataSet dsReport = new DataSet();
        DataTable dt = new DataTable();


        dt.Columns.Add("BriefName");
        dt.Columns.Add("CandidateName");
        dt.Columns.Add("CurrentStage");
        dt.Columns.Add("CurrentStatus");



        DataRow r = dt.NewRow();

        r["BriefName"] = "Brief001";
        r["CandidateName"] = "Cristiano Best";
        r["CurrentStage"] = "Regional Director - Review";
        r["CurrentStatus"] = "OnTrack";


        dt.Rows.Add(r);

        r = dt.NewRow();

        r["BriefName"] = "Brief002";
        r["CandidateName"] = "Zindine Thomas";
        r["CurrentStage"] = "Auditor - Review";
        r["CurrentStatus"] = "Delayed";

        dt.Rows.Add(r);

        r = dt.NewRow();

        r["BriefName"] = "BRIEF019";
        r["CandidateName"] = "George Abott";
        r["CurrentStage"] = "Industry Expert - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);

        r = dt.NewRow();

        r["BriefName"] = "BRIEF011";
        r["CandidateName"] = "Sergio Thomas";
        r["CurrentStage"] = "RL Assessor - Review";
        r["CurrentStatus"] = "Delayed";

        dt.Rows.Add(r);
        r = dt.NewRow();

        r["BriefName"] = "BRIEF79";
        r["CandidateName"] = "Xavi Frenandez";
        r["CurrentStage"] = "Global Director - Review";
        r["CurrentStatus"] = "Completed";

        dt.Rows.Add(r);
        r = dt.NewRow();

        r["BriefName"] = "BRIEF80";
        r["CandidateName"] = "Deigo Shook";
        r["CurrentStage"] = "Mod Assessor - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);
        r = dt.NewRow();


        r["BriefName"] = "BRIEF83";
        r["CandidateName"] = "Cristiano Best";
        r["CurrentStage"] = "Industry Expert - Review";
        r["CurrentStatus"] = "Delayed";

        dt.Rows.Add(r);
        r = dt.NewRow();

        r["BriefName"] = "BRIEF90";
        r["CandidateName"] = "Jeremy Lewis";
        r["CurrentStage"] = "Regional Director - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);
        r = dt.NewRow();
        r["BriefName"] = "BRIEF34";
        r["CandidateName"] = "Cristiano Best";
        r["CurrentStage"] = "Industry Expert - Review";
        r["CurrentStatus"] = "Completed";

        dt.Rows.Add(r);
        r = dt.NewRow();
        r["BriefName"] = "BRIEF37";
        r["CandidateName"] = "Jose Jackson";
        r["CurrentStage"] = "RL Assessor - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);
        r = dt.NewRow();
        r["BriefName"] = "BRIEF17";
        r["CandidateName"] = "Sergio Ramos";
        r["CurrentStage"] = "Global Director - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);
        r = dt.NewRow();
        r["BriefName"] = "BRIEF187";
        r["CandidateName"] = "Manuel Neuer";
        r["CurrentStage"] = "Mod Assessor - Review";
        r["CurrentStatus"] = "Delayed";

        dt.Rows.Add(r);

        r = dt.NewRow();
        r["BriefName"] = "BRIEF145";
        r["CandidateName"] = "Ramadel Falco";
        r["CurrentStage"] = "Auditor - Review";
        r["CurrentStatus"] = "Completed";

        dt.Rows.Add(r);

        r = dt.NewRow();
        r["BriefName"] = "BRIEF134";
        r["CandidateName"] = "Lio Tamana";
        r["CurrentStage"] = "RL Assessor - Review";
        r["CurrentStatus"] = "OnTrack";

        dt.Rows.Add(r);

        dsReport.Tables.Add(dt);
        //dsReport = DataUtils.ExecuteDataset("usp_GetBranchDetails", txtSearch.Text.Trim(), txtbranchCode.Text.Trim());
        return dsReport;
    }


    protected void gvRegistrationStatusDashboard_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string strCell = Convert.ToString(e.Row.Cells[3].Text);

            if (strCell == "OnTrack")          
                e.Row.Cells[3].BackColor = System.Drawing.Color.Red;
            else if (strCell == "Delayed")
                e.Row.Cells[3].BackColor = System.Drawing.Color.Yellow;
            else if (strCell == "Completed")           
                e.Row.Cells[3].BackColor = System.Drawing.Color.Green;          
        }


    }
}